#!/bin/sh
ORG_PATH="github.com/hustcat"
REPO_PATH="${ORG_PATH}/k8s-rdma-device-plugin"

export GO15VENDOREXPERIMENT=1
export GOBIN=${PWD}/bin
#export GOPATH=${PWD}/gopath

FMT="*.go"
echo "Checking gofmt..."
fmtRes=$(gofmt -l $FMT)
if [ -n "${fmtRes}" ]; then
    echo -e "gofmt checking failed:\n${fmtRes}"
    exit 255
fi

echo "Building plugins"
go install "$@" ${REPO_PATH}
